package com.xinsilu.hospital.controller;


import com.xinsilu.common.Result;
import com.xinsilu.hospital.entity.NoHospitalizationTable;
import com.xinsilu.hospital.service.INoHospitalizationTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ym
 * @since 2021-09-22
 */
@RestController
@RequestMapping("/api/hospital/noHospitalizationTable")
public class NoHospitalizationTableController {
    @Autowired
    private INoHospitalizationTableService nnService;

    @PostMapping("/addyaopin")
    public Object addyaopin(NoHospitalizationTable noHospitalizationTable){
        boolean save = nnService.save(noHospitalizationTable);
        if(save){
            return Result.ok("成功");
        }
        return Result.ok(save);
    }
    @RequestMapping("/getgoumai")
    public Object getgoumai(NoHospitalizationTable noHospitalizationTable){
        System.out.println(noHospitalizationTable);

        List<NoHospitalizationTable> getgoumai = nnService.getgoumai(noHospitalizationTable);
        return Result.ok(getgoumai);
    }
}
